package com.jiajia.server.utils;

import com.jiajia.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 获取admin对象（当前登录对象）
 * @author ZSJia
 * @date 2021/8/15 015 - 11:06
 */
public class AdminUtils {


    public static Admin getAdmin(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
